import java.util.Scanner;

public class digital_encryption {
    public static void main(String[] args) {
        Scanner se = new Scanner(System.in);
        int input = se.nextInt();
        int[] arr = split(input);
        encryption(arr);
        for (int i = 0; i < 4; i++) {
            System.out.print(arr[i]);
        }
    }

    public static void encryption(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] += 5;
            arr[i] %= 10;
        }
    }

    public static int[] split(int n) {
        int[] arr = new int[4];
        int i = 0;
        while (n > 0) {
            arr[i] = n % 10;
            n /= 10;
            i++;
        }
        return arr;
    }
}
